<?php
namespace app\servercertificate\validate;
use \app\manage\validate\BaseValidate;

class Certificate extends BaseValidate
{
    
	protected $rule =   [
        'id' => ['integer','gt'=>0],
        'certificate_id' => ['integer','gt'=>0],
        'user_id'  => ['integer','gt'=>0],
        'goods_id'  => ['integer','gt'=>0],
        'user_info'  => ['array','min'=>1],
		'goods_info'  => ['array','min'=>5],
        'page'=>['integer','gt'=>0],
        'listRows'=>['integer','gt'=>0,'elt'=>50],
        'title'=>['length'=>'2,50'],
        'product_code'=>['length'=>'21'],
        'cate_name'=>['length'=>'2,30'],
        'standart'=>['min'=>'2'],
        'seo_desc'=>['min'=>'2'],
        'name'=>['length'=>'2,25'],
        'status'=>['in'=>'1,2'],
        'is_pick'=>['in'=>'0,1'],
        'is_transfer'=>['in'=>'0,1'],
        'type'=>['in'=>['all','advanced','common']],
        'logistics_company_code' => ['alphaNum'],
        'waybill_number' => ['alphaNum'],
        'logistics_company_name' => ['min'=>2],
        'is_use_distribute' => ['in'=>'0,1'],
        'neq_distribute_time' => ['dateFormat'=>'Y-m-d'],
    ];

    protected $message  =   [
        'id' => '没有要选择的元素',
        'user_id' => '用户user_id为大于0的整数',
        'goods_id' => '商品goods_id为大于0的整数',
        'user_info' => '请传入用户信息',
        'goods_info' => '请传入商品信息[title],[product_code],[cate_name],[standart],[seo_desc]',
        'page' => '当前页为大于0的整数',
        'listRows' => '每页显示的条数范围为1-50',
        'title' => '艺术品信息中的标题为2-50个字符',
        'product_code' => '编号为21个字符',
        'cate_name' => '艺术品信息中的材质为2-30个字符',
        'standart' => '请传入艺术品信息中的规格信息',
        'seo_desc' => '请传入艺术品信息中的描述信息',
        'name' => '持有人信息中的账号name为2-25个字符',
        'status' => '1 为审核成功 2 为审核失败',
        'type' => 'all 全部证书 advanced 高级证书 common 普通证书',
    ];

    protected $scene = [
        'adminAllCertiList' => [
            'type' => ['in'=>['advanced','common']],
            'is_pick','is_transfer',
            'status'=>['require','in'=>'0,1,2,3'],
            'page'=>['require','integer','gt'=>0],
            'listRows'=>['require','integer','gt'=>0,'elt'=>50],
            'is_use_distribute'
        ],
        'invalid' => [
            'id' => ['require','integer','gt'=>0],
        ],
        'certificateInfo' => [
            'id' => ['require','integer','gt'=>0],
        ],
        'auditOneCertificate' => [
            'id' => ['require','integer','gt'=>0],
            'status' =>['in'=>'1,2'],
        ],
        'userCertiList' => [
            'page','listRows',
            'user_id' => ['require','gt'=>0],
            'type' => ['in'=>['advanced','common']],
            'is_pick','is_transfer',
            'status'=>['in'=>'0,1,2'],
        ]
    ];

}